﻿namespace Elasticsearch.Service
{
    /// <summary>
    /// 索引服务接口
    /// </summary>
    public interface IIndexService
    {
        /// <summary>
        /// 创建索引
        /// </summary>
        /// <param name="indexName">索引名称</param>
        /// <param name="mappings">索引映射</param>
        /// <returns>创建结果</returns>
        //Task<bool> CreateIndexAsync(string indexName, object? mappings = null);

        /// <summary>
        /// 删除索引
        /// </summary>
        /// <param name="indexName">索引名称</param>
        /// <returns>删除结果</returns>
        Task<bool> DeleteIndexAsync(string indexName);

        /// <summary>
        /// 检查索引是否存在
        /// </summary>
        /// <param name="indexName">索引名称</param>
        /// <returns>是否存在</returns>
        Task<bool> IndexExistsAsync(string indexName);

        /// <summary>
        /// 获取索引信息
        /// </summary>
        /// <param name="indexName">索引名称</param>
        /// <returns>索引信息</returns>
        Task<object?> GetIndexInfoAsync(string indexName);

        /// <summary>
        /// 获取所有索引
        /// </summary>
        /// <returns>索引列表</returns>
        //Task<List<string>> GetAllIndicesAsync();

        /// <summary>
        /// 重建索引
        /// </summary>
        /// <param name="sourceIndex">源索引</param>
        /// <param name="targetIndex">目标索引</param>
        /// <returns>重建结果</returns>
        //Task<bool> ReindexAsync(string sourceIndex, string targetIndex);

        /// <summary>
        /// 更新索引设置
        /// </summary>
        /// <param name="indexName">索引名称</param>
        /// <param name="settings">设置</param>
        /// <returns>更新结果</returns>
        //Task<bool> UpdateIndexSettingsAsync(string indexName, object settings);

        /// <summary>
        /// 创建用户索引（包含完整的映射配置）
        /// </summary>
        /// <returns>创建结果</returns>
        Task<bool> CreateUserIndexAsync();
    }
}
